/*
  Diamond Girl - Game where player collects diamonds.
  Copyright (C) 2005-2014  Joni Yrjänä <joniyrjana@gmail.com>
  
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


  Complete license can be found in the LICENSE file.
*/

#ifndef GFX_GLYPH_H_
#define GFX_GLYPH_H_

#include <stdbool.h>
#ifdef WITH_OPENGL
#include <GL/glew.h>
#endif

enum MAP_GLYPH;
enum MOVE_DIRECTION;
struct gfxbuf;

extern bool gfx_glyph_initialize(void);
extern void gfx_glyph_cleanup(void);

extern void    gfx_frame0(void);
extern void    gfx_next_frame(void);
extern uint8_t gfx_get_frame(enum MAP_GLYPH glyph); /* Return the current frame of a glyph. */
extern uint8_t gfx_get_maxframe(enum MAP_GLYPH glyph); /* Return the max frame of a glyph. */
extern void    gfx_set_current_glyph_set(int glyph_set);

#ifdef WITH_OPENGL
extern void gfx_glyph_render(struct gfxbuf * gfxbuf, int x, int y, enum MAP_GLYPH glyph, enum MOVE_DIRECTION facing);
extern void gfx_glyph_render_frame(struct gfxbuf * gfxbuf, int x, int y, enum MAP_GLYPH glyph, enum MOVE_DIRECTION facing, int frame);
#endif

#ifdef WITH_NONOPENGL
extern void gfx_draw_glyph(int x, int y, enum MAP_GLYPH glyph, enum MOVE_DIRECTION facing);
extern void gfx_draw_glyph_frame(int x, int y, enum MAP_GLYPH glyph, enum MOVE_DIRECTION facing, int frame);
#endif

#endif
